// src/stores/sidebarStore.ts

import { defineStore } from 'pinia';

export const useSidebarStore = defineStore('sidebar', {
    state: () => ({
        collapsed: false, // 是否收缩
        fullCollapsed: false, // 是否完全收起
        overlayVisible: false, // 控制遮罩是否显示
    }),

    actions: {
        toggleCollapse() {
            this.collapsed = !this.collapsed;
        },
        setOverlayVisible(value: boolean) {
            this.overlayVisible = value;
        },
        toggleFullCollapse() {
            this.fullCollapsed = !this.fullCollapsed;
            this.collapsed = this.fullCollapsed; // 确保完全收缩时，菜单也折叠
        }
    }
});
